package net.xdclass.service;

import net.xdclass.controller.request.ShortLinkAddRequest;
import net.xdclass.controller.request.ShortLinkDelRequest;
import net.xdclass.controller.request.ShortLinkPageRequest;
import net.xdclass.controller.request.ShortLinkUpdateRequest;
import net.xdclass.model.EventMessage;
import net.xdclass.model.ShortLinkDO;
import com.baomidou.mybatisplus.extension.service.IService;
import net.xdclass.model.vo.ShortLinkVO;
import net.xdclass.util.JsonData;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author hr
 * @since 2025-08-04
 */
public interface IShortLinkService extends IService<ShortLinkDO> {
    /**
     * 解析短链码
     * @param shortLinkCode
     * @return
     */

    ShortLinkVO parseShortLinkCode(String shortLinkCode);


    /**
     * 创建短链
     * @param request
     * @return
     */
    JsonData createShortLink(ShortLinkAddRequest request);
    /**
     * 处理添加短链事件
     * @param eventMessage
     * @return
     */
    boolean handleAddShortLink(EventMessage eventMessage);
    /**
     * 分页查询短链
     * @param request
     * @return
     */

    Map<String, Object> pageByGroupId(ShortLinkPageRequest request);

    JsonData del(ShortLinkDelRequest request);

    JsonData update(ShortLinkUpdateRequest request);

    /**
     * 更新短链
     *
     * @param eventMessage
     * @return
     */
    boolean handleUpdateShortLink(EventMessage eventMessage);
    /**
     * 删除短链
     * @param eventMessage
     * @return
     */
    boolean handleDelShortLink(EventMessage eventMessage);
}
